package com.szmengran.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;


/**
 * @description: Response with single record to return
 * @author Joe
 * @date 2021/10/11 15:54
 * @version 1.0
 */
@Data
public class SingleResponse<T> extends Response implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("数据")
    private T data;

    public SingleResponse(T data) {
        super();
        this.data = data;
    }

    /**
     * @description: 成功返回结果
     * @param: data
     * @return: com.zhenai.dto.Response<T>
     * @author Joe
     * @date: 2021/10/11 17:48
     */
    public static <T> SingleResponse<T> success(T data) {
        return new SingleResponse<T>(data);
    }

}
